package com.aerotechnic.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Table(name = "MACROTACHE")
public class MacroTache extends MacroTacheBiblio{

	/**
	 * 
	 */   
	private static final long serialVersionUID = 1L;    

	@Column(name = "datedebut")
	private Date dateDebut;
	@Column(name = "duration")
	private int duration;
	@Column(name = "progress")
	private float progress;
	
	// links
	@OneToMany(fetch = FetchType.EAGER, targetEntity = JobCard.class)
	private Set<JobCard> jobCard = new HashSet<JobCard>(0);
	// macrotache parent
//	@OneToOne(fetch = FetchType.EAGER, targetEntity = MacroTache.class)
	private Long parent;
	
	
	public Set<JobCard> getJobCard() {
		return jobCard;
	}
	public void setJobCard(Set<JobCard> jobCard) {
		this.jobCard = jobCard;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	public Date getDateDebut() {
		return dateDebut;
	}
	public void setDateDebut(Date dateDebut) {
		this.dateDebut = dateDebut;
	}
	
	public int getDuration() {
		return duration;
	}
	public void setDuration(int duration) {
		this.duration = duration;
	}
	
	public Long getParent() {
		return parent;
	}
	public void setParent(Long parent) {
		this.parent = parent;
	}
	public float getProgress() {
		return progress;
	}
	public void setProgress(float progress) {
		this.progress = progress;
	}
	@Override
	public String toString() {
		return "MacroTache [dateDebut=" + dateDebut + ", duration=" + duration
				+ ", progress=" + progress + ", jobCard=" + jobCard
				+ ", parent=" + parent + ", isSMOHolder=" + isSMOHolder
				+ ", description=" + description + ", zone=" + zone
				+ ", phase=" + phase + ", specialite=" + specialite
				+ ", intitule=" + intitule + ", id=" + id + "]";
	}
	
}
